package com.qhhc.hospital.service.impl;

import com.qhhc.hospital.entity.Arrange;
import com.qhhc.hospital.mapper.ArrangeMapper;
import com.qhhc.hospital.service.IArrangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArrangeService implements IArrangeService {
    @Autowired
    ArrangeMapper arrangeMapper;
    
    @Override
    public int insert(Arrange arrange) {
        int count = arrangeMapper.insertArrange(arrange);
        return count;
    }
    
    @Override
    public List<Arrange> selectAll() {
        List<Arrange> arranges = arrangeMapper.selectAllArranges();
        return arranges;
    }
    
    @Override
    public Arrange selectById(String arId) {
        Arrange arrange = arrangeMapper.selectArrangeById(arId);
        return arrange;
    }
    
    @Override
    public List<Arrange> selectByDoctorId(Integer dId) {
        List<Arrange> arranges = arrangeMapper.selectArrangeByDoctorId(dId);
        return arranges;
    }
    
    @Override
    public int update(Arrange arrange) {
        return arrangeMapper.updateArrange(arrange);
    }
    
    @Override
    public int delete(String arId) {
        return arrangeMapper.deleteArrange(arId);
    }
} 